import 'package:json_annotation/json_annotation.dart';

class BigIntConverter implements JsonConverter<BigInt, String> {
  const BigIntConverter();

  @override
  BigInt fromJson(String json) {
    try {
      return BigInt.parse(json);
    } catch (e) {
      throw FormatException('Invalid BigInt format: $json');
    }
  }

  @override
  String toJson(BigInt object) => object.toString();
}
